import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'

Vue.use(VueRouter)

const routes = [
  {
    path:'/',
    redirect:'/home'
  },
  {  
    //登录页面  
    path: '/home',
    component: Home,
  },
  {
    //系统功能
    path: '/home/funindex',
    component: () => import(/* webpackChunkName: "funindex" */ '../components/Funindex.vue')
  },
  {
    //送货单
    path: '/home/funindex/dispatchList',
    component: () => import(/* webpackChunkName: "dispatchList" */ '../components/DispatchList.vue')
  },
  {
    //送货单/评价单
    name:'pingjiadan',
    path: '/pingjiadan/:id',
    component: () => import(/* webpackChunkName: "pingjiadan" */ '../components/Pingjiadan.vue')
  },
  {
    //送货单/确定订单
    name:'goods',
    path: '/goods/:id',
    component: () => import(/* webpackChunkName: "goods" */ '../components/component/goods.vue')
  },
  {
    //客户信息
    path: '/home/funindex/customers',
    component: () => import(/* webpackChunkName: "customers" */ '../components/Customers.vue')
  },
  {
    //客户关怀
    path: '/home/funindex/customerCare',
    component: () => import(/* webpackChunkName: "customerCare" */ '../components/CustomerCare.vue')
  },
  {
    //物流单评价
    path: '/home/funindex/logisticsList',
    component: () => import(/* webpackChunkName: "logisticsList" */ '../components/LogisticsList.vue')
  },
  {
    //消息中心
    path: '/home/funindex/messageCenter',
    component: () => import(/* webpackChunkName: "messageCenter" */ '../components/MessageCenter.vue')
  },
  {
    //消息详情
    path: '/messageID/:id',
    component: () => import(/* webpackChunkName: "messageID" */ '../components/component/messageID.vue')
  },
  {
    //个人中心
    path: '/user/',
    component: () => import(/* webpackChunkName: "user" */ '../components/User.vue')
  },
  {
    //个人信息
    path: '/userList/',
    component: () => import(/* webpackChunkName: "userList" */ '../components/component/uersList.vue')
  },
  {
    //版本
    path: '/banben/',
    component: () => import(/* webpackChunkName: "banben" */ '../components/component/banBen.vue')
  },
  {
    //评价物流单
    path: '/pingjiagood/',
    component: () => import(/* webpackChunkName: "pingjia" */ '../components/star/goodpingjia.vue')
  },
  {
    //查看评价物流单
    path: '/good/:id',
    component: () => import(/* webpackChunkName: "pingjia" */ '../components/star/good.vue')
  },
  {
    //查看评价物流单
    path: '/goodCust/:id',
    component: () => import(/* webpackChunkName: "goodCust" */ '../components/cust/good.vue')
  },
  {
    //获取客户信息详情
    path: '/custID/:id',
    component: () => import(/* webpackChunkName: "custID" */ '../components/cust/custID.vue')
  },
  {
    //修改客户信息
    path: '/custXG/:id',
    component: () => import(/* webpackChunkName: "custXG" */ '../components/cust/custXG.vue')
  },
  {
    //新增客户信息
    path: '/custXZ/',
    component: () => import(/* webpackChunkName: "custXZ" */ '../components/cust/custXZ.vue')
  },
  {
    //新增客户拜访
    path: '/visitXZ/',
    component: () => import(/* webpackChunkName: "visitXZ" */ '../components/visit/visitXZ.vue')
  },
  {
    //选择客户
    path: '/visitKH/',
    component: () => import(/* webpackChunkName: "visitKH" */ '../components/visit/visitKH.vue')
  },
  {
    //获取走访信息详情
    path: '/visitXQ/:id',
    component: () => import(/* webpackChunkName: "visitXQ" */ '../components/visit/visitXQ.vue')
  },
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
